#include<iostream>
#include<string>
#include<vector>
#include<cctype>
using namespace std;

int main(){
    vector<string> svec;
    string str;
    
    cout<<"Enter text(Ctrl+Z to end):"<<endl;
    while(cin>>str)
      svec.push_back(str);
      
    cout<<"Transformed elements from the vector:"<<endl;
    for(vector<string>::size_type ix=0;ix!=svec.size();++ix)
    {
        for(string::size_type index=0;index!=svec[ix].size();++index)
          if(islower(svec[ix][index]))
          svec[ix][index]=toupper(svec[ix][index]);
          cout<<svec[ix]<<" ";
          if((ix+1)%8==0)cout<<endl;
    }
    return 0;
}

#include <iostream>
#include <vector>
#include <list>
using namespace std;

template <class T>
class Test {
	public:
		void insert(const T& x) {
			lists.push_back(x);
		}
		void display() {
			typename std::list<T>::iterator iter; //模板类型的迭代器
			for(iter = lists.begin();iter != lists.end();iter++)
				cout<<*iter<<" ";
			cout<<endl;
		}
	private:
		list<T> lists;
};

int main() {
	Test<int> t;
	t.insert(10);
	t.insert(20);
	t.insert(30);
	t.insert(40);
	t.display();
	return 0;
}


#include <iostream>
using namespace std;

template <typename T>
struct is_void{
    static const bool value = false;
};

template <>
struct is_void<void>{
    static const bool value = true;
};

int main(int argc, char** argv){
    std::cout<<is_void<int>::value<<endl;

    std::cout<<is_void<void>::value;
    return 0;
}

#include <iostream>
#include<vector>
#include<iterator>
using namespace std;
int main(int argc, char** argv){
	vector<int> v;
	v.reserve(10);
	for(int i = 1; i <= 10; ++i) v.push_back(i);
	//int casts[10]={4,5,6,2,22,34,21,67,90,10};
	//vector<int>v(10);
	//copy(casts,casts+10,v.begin());
	//ostream_iterator<int,char> ost(cout,"\n");
	ostream_iterator<int> ost(cout, "\n");
	copy(v.begin(), v.end(), ost);
	cout<<endl;
	return 0;
}
